/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Presentacion;

import Clases.Controlador;
import Clases.Fechas;
import Dominio.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import javax.swing.JOptionPane;

/**
 *
 * @author matias
 */
public class JIntFrameClientes extends javax.swing.JInternalFrame {

    /**
     * Creates new form JIntFrameClientes
     */
    public Controlador Drive;
    private Empresa em;
    private Categorias cat;
    private Date fechanac;
    private Fechas fecha = new Fechas();

    public JIntFrameClientes(Controlador unDrive) {
        this.Drive = unDrive;
        initComponents();
        manejoFechaHora();
        ComboEmpresa();
        ComboCategorias();
        fecha.CargarAños(jComboAnio);
        fecha.CargarMeses(jComboMes);
        fecha.CargarDias(jComboDia, jComboMes, jComboAnio);
        jComboAnio.setSelectedItem("2012");
        GrupoOpt.add(jRadioFemenino);
        GrupoOpt.add(jRadioMasculino);
        GrupoEstado.add(jRadioHabilitado);
        GrupoEstado.add(jRadioNoHabilitado);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    //Metodos
    private void ComboEmpresa() {
        List<Empresa> empresa = Drive.getPERSISTENCIA().getEmpresas();
        int a = 0;

        Iterator it = empresa.iterator();
        em = empresa.get(a);
//        jTextField3.setText(String.valueOf(re.getNroSucursal()));
        while (it.hasNext()) {

            em = empresa.get(a);
            a++;
            it.next();
            jComboEmpresa.addItem(em.getDescripcion());

        }
    }

    private void ComboCategorias() {
        List<Categorias> categoria = Drive.getPERSISTENCIA().getCategorias();
        int a = 0;

        Iterator it = categoria.iterator();
        cat = categoria.get(a);

        while (it.hasNext()) {

            cat = categoria.get(a);
            a++;
            it.next();
            jComboCategoria.addItem(cat.getDescripcion());

        }
    }

    private void manejoFechaHora() {


        //Codigo Comprado de internet para guardar la fecha
        try {
            String str_date = jComboDia.getSelectedItem().toString() + "-" + jComboMes.getSelectedItem().toString() + "-" + jComboAnio.getSelectedItem().toString();
            DateFormat formatter;
            Date date;
            formatter = new SimpleDateFormat("dd-MM-yy");
            date = (Date) formatter.parse(str_date);
            Calendar cal = Calendar.getInstance();
            cal.setTime(date);
            fechanac = date;
        } catch (Exception ex) {
        }



    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        GrupoOpt = new javax.swing.ButtonGroup();
        GrupoEstado = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jTextApel = new javax.swing.JTextField();
        jTextNombre = new javax.swing.JTextField();
        jTextApodo = new javax.swing.JTextField();
        jTextMail = new javax.swing.JTextField();
        jTextCelular = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jBotIdentificar = new javax.swing.JButton();
        jBotSalir = new javax.swing.JButton();
        jBotGuardar = new javax.swing.JButton();
        jComboEmpresa = new javax.swing.JComboBox();
        jPanel3 = new javax.swing.JPanel();
        jRadioFemenino = new javax.swing.JRadioButton();
        jRadioMasculino = new javax.swing.JRadioButton();
        jComboDia = new javax.swing.JComboBox();
        jComboMes = new javax.swing.JComboBox();
        jComboAnio = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        jComboCategoria = new javax.swing.JComboBox();
        jPanel4 = new javax.swing.JPanel();
        jRadioHabilitado = new javax.swing.JRadioButton();
        jRadioNoHabilitado = new javax.swing.JRadioButton();

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Cliente"));

        jLabel1.setText("Apellido:");

        jLabel2.setText("Nombre:");

        jLabel3.setText("Apodo:");

        jLabel4.setText("Fecha Nacimiento:");

        jLabel5.setText("Mail:");

        jLabel6.setText("Celular:");

        jLabel7.setText("Empresa:");

        jTextApel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextApelActionPerformed(evt);
            }
        });

        jTextApodo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextApodoActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Huella Digital"));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 162, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 111, Short.MAX_VALUE)
        );

        jBotIdentificar.setText("Identificar");
        jBotIdentificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBotIdentificarActionPerformed(evt);
            }
        });

        jBotSalir.setText("Salir");
        jBotSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBotSalirActionPerformed(evt);
            }
        });

        jBotGuardar.setText("Guardar");
        jBotGuardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBotGuardarActionPerformed(evt);
            }
        });

        jComboEmpresa.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Seleccionar" }));

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Sexo"));

        jRadioFemenino.setText("Femenino");

        jRadioMasculino.setSelected(true);
        jRadioMasculino.setText("Masculino");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jRadioMasculino, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jRadioFemenino, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jRadioMasculino)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioFemenino))
        );

        jLabel8.setText("Categoria:");

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Estado"));

        jRadioHabilitado.setText("No Habilitado");

        jRadioNoHabilitado.setSelected(true);
        jRadioNoHabilitado.setText("Habilitado");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jRadioNoHabilitado)
                    .addComponent(jRadioHabilitado))
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jRadioNoHabilitado)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioHabilitado)
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(14, 14, 14)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jBotIdentificar)
                                .addGap(18, 18, 18)
                                .addComponent(jBotGuardar)
                                .addGap(75, 75, 75))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addGap(18, 18, 18)
                                .addComponent(jTextCelular, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel7)
                                .addGap(18, 18, 18)
                                .addComponent(jComboEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jBotSalir))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(18, 18, 18)
                        .addComponent(jComboCategoria, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel5)
                                    .addGap(28, 28, 28)
                                    .addComponent(jTextMail, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel2)
                                        .addComponent(jLabel3))
                                    .addGap(18, 18, 18)
                                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jTextNombre)
                                        .addGroup(jPanel1Layout.createSequentialGroup()
                                            .addComponent(jTextApodo, javax.swing.GroupLayout.PREFERRED_SIZE, 218, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(0, 0, Short.MAX_VALUE))))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addGap(18, 18, 18)
                                    .addComponent(jTextApel)))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jLabel4)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jComboDia, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jComboMes, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jComboAnio, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 140, Short.MAX_VALUE)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jTextApel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jTextNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(jTextApodo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jComboDia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jComboMes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jComboAnio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(12, 12, 12)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(jTextMail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jComboCategoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(19, 19, 19)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jTextCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel7)
                    .addComponent(jComboEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jBotIdentificar)
                            .addComponent(jBotGuardar))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jBotSalir))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextApelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextApelActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextApelActionPerformed

    private void jTextApodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextApodoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextApodoActionPerformed

    private void jBotIdentificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBotIdentificarActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jBotIdentificarActionPerformed

    private void jBotSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBotSalirActionPerformed
        this.dispose();
    }//GEN-LAST:event_jBotSalirActionPerformed

    private void jBotGuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBotGuardarActionPerformed
        try {

            char sexo;
            if (jRadioFemenino.isSelected()) {
                sexo = 'F';
            } else {
                sexo = 'M';
            }

            byte[] huella = new byte[1000];
            byte[] foto = new byte[1000];
            Boliche boliche = Drive.getBoliche();
            Empresa unaEmpresa = Drive.getEmpresa(jComboEmpresa.getSelectedItem().toString());
            Categorias unaCategoria = Drive.getCategoria(jComboCategoria.getSelectedItem().toString());
            Set<CuentaCorrientes> unaCtaCte = new HashSet<CuentaCorrientes>(0);
            Set<Movimientos> unMovimiento = new HashSet<Movimientos>(0);
            
            Clientes unCliente = new Clientes(unaEmpresa,
                    unaCategoria,
                    boliche,
                    jTextApel.getText().toUpperCase(),
                    jTextNombre.getText().toUpperCase(),
                    jTextApodo.getText().toUpperCase(),
                    huella,
                    fechanac,
                    jTextMail.getText(),
                    jTextCelular.getText(),
                    true,
                    "",
                    foto,
                    sexo,
                    unaCtaCte,
                    unMovimiento);
                    
            
                    
            Drive.crearCliente(unCliente);
            
           



            jTextApel.setText("");
            jTextNombre.setText("");
            jTextApodo.setText("");
            jTextCelular.setText("");
            jTextMail.setText("");

            jTextApel.requestFocus();

        } catch (Exception ex) {
            JOptionPane.showMessageDialog(null, ex.toString());
        }

    }//GEN-LAST:event_jBotGuardarActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup GrupoEstado;
    private javax.swing.ButtonGroup GrupoOpt;
    private javax.swing.JButton jBotGuardar;
    private javax.swing.JButton jBotIdentificar;
    private javax.swing.JButton jBotSalir;
    private javax.swing.JComboBox jComboAnio;
    private javax.swing.JComboBox jComboCategoria;
    private javax.swing.JComboBox jComboDia;
    private javax.swing.JComboBox jComboEmpresa;
    private javax.swing.JComboBox jComboMes;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JRadioButton jRadioFemenino;
    private javax.swing.JRadioButton jRadioHabilitado;
    private javax.swing.JRadioButton jRadioMasculino;
    private javax.swing.JRadioButton jRadioNoHabilitado;
    private javax.swing.JTextField jTextApel;
    private javax.swing.JTextField jTextApodo;
    private javax.swing.JTextField jTextCelular;
    private javax.swing.JTextField jTextMail;
    private javax.swing.JTextField jTextNombre;
    // End of variables declaration//GEN-END:variables
}
